<template>
  <el-dialog
    v-model="visible"
    title="日志"
    :width="'30%'"
    destroy-on-close
    @closed="$emit('closed')"
    :show-close="false"
    style="overflow: scroll"
  >
    <Jsontree :data="jsonData"></Jsontree>
    <template #footer>
      <el-button @click="visible = false">关 闭</el-button>
    </template>
  </el-dialog>
</template>

<script>
import Jsontree from 'vue-json-tree'

export default {
  components: {
    Jsontree
  },
  emits: ['success', 'closed'],
  data() {
    return {
      visible: false,
      jsonData: {}
    }
  },
  mounted() {},
  methods: {
    //显示
    open() {
      //   this.mode = mode
      this.visible = true
      return this
    },
    //注入数据
    setData(data) {
      // alert(data)

      this.jsonData = JSON.parse(data)
    }
  }
}
</script>
